﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QTableWidgetItem>
#include "common.h"

#include <QtCharts/QChartView>
#include <QtCharts/QLineSeries>
#include <QtCharts/QPieSeries>
#include <QtCharts/QPieSlice>

#include "qcustomplot.h"

QT_CHARTS_USE_NAMESPACE


namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private:
    Ui::MainWindow *ui;

    int appMonitorLogCount;

    int sysMonitorLogCount;

    void updateLogButtonText();

    void updateSysAlertLogButtonText();

    void checkSysRegErrorReportDontOpenUI();

    void checkAutoStart();

    void initSysSettingView();

private slots:

    void diskUsageUpdated();

    void memUsageUpdated();

    void cpuUsageUpdated();

    void freshAppMonitor();

    void onItemClicked(QTableWidgetItem* item);

    void onItemDoubleClicked(QTableWidgetItem* item);

    void onCreateButtonClicked();

    void onShowMonitorLogLicked();

    void onMonitorLogIncrease();

    void onSysMonitorLogIncrease();

    void changeSysRegErrorReportDontOpenUISetting();

    void changeAutoStartSetting(bool autoStart);

    void onReportStatusStateChanged(int state);

    void on_memAlarmThresholdLineEdit_editingFinished();
    void on_memCheckIntervalSecondLineEdit_editingFinished();


    void on_cpuAlarmThresHoldLineEdit_editingFinished();
    void on_cpuCheckIntervalSecondsLineEdit_editingFinished();
    void on_diskAlarmThresHoldLineEdite_editingFinished();
    void on_diskCheckIntrvalSecondsLineEdite_editingFinished();
    void on_watchDogServerIPLineEdite_editingFinished();
    void on_watchDogServerPortLineEdite_editingFinished();
    void on_sysAlertLogButton_clicked();
    void on_listenSocketLineEdite_editingFinished();


    void on_logButton_clicked();
};



#endif // MAINWINDOW_H
